package com.pd.backend.controller;

import com.pd.backend.dtos.ResponseResult;
import com.pd.backend.dtos.LoginDto;
import com.pd.backend.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户控制层
 *
 * @author wjj
 * @date 2023/1/10 21:47
 **/
@RestController
@RequestMapping("/login/v1")
public class UserController {

    @Autowired
    private UserService userService;

    /**
     * 用户登录
     * @param loginDto
     * @return
     */
    @PostMapping("/auth_user")
    public ResponseResult userLogin(@RequestBody LoginDto loginDto) {
        return userService.userLogin(loginDto);
    }

}
